document.addEventListener('keydown', function (event) {
    if (event.key === 's') {
        // 按下's'键时添加下滑类
        document.getElementById('dino').classList.add('crouching');
        document.getElementById('dino').classList.remove('standing');
        console.log('鬼魂下滑');
    }
});

document.addEventListener('keyup', function (event) {
    if (event.key === 's') {
        // 释放's'键时移除下滑类，恢复站立类
        document.getElementById('dino').classList.remove('crouching');
        document.getElementById('dino').classList.add('standing');
        console.log('鬼魂恢复');
    }
});

document.addEventListener('keydown', function (event) {
    if (event.key === 'w') {
        // 按下'w'键时添加上升类
        document.getElementById('dino').classList.add('up');
        document.getElementById('dino').classList.remove('standing');
        console.log('鬼飞天');
    }
});

document.addEventListener('keyup', function (event) {
    if (event.key === 'w') {
        // 释放'w'键时移除上升类，恢复站立类
        document.getElementById('dino').classList.remove('up');
        document.getElementById('dino').classList.add('standing');
        console.log('鬼魂回归');
    }
});

